package hoodoos.flow;

public enum FlowRuleTypeEnum {

  PROCESS_START("process-start"),
  PROCESS_END("process-end"),
  PROCESS_BRANCH("process-branch"),
  PROCESS_PARALLEL("process-parallel"),
  PROCESS_MERGE("process-merge"),
  RULE("rule"),
  ;

  private final String code;

  FlowRuleTypeEnum(String code) {
    this.code = code;
  }

  public String getCode() {
    return code;
  }

  public static FlowRuleTypeEnum getByCode(String code) {
    for (FlowRuleTypeEnum value : FlowRuleTypeEnum.values()) {
      if (value.code.equals(code)) {
        return value;
      }
    }
    return null;
  }
}
